from aip import AipOcr

APP_ID = '23701409'
API_KEY = 'UCgaOAyzD5qUMFS3ffC0eVV9'
SECRET_KEY = 'sSsyHv8lVShc3bSVIXqYGQC46wHDsVFX'

client = AipOcr(APP_ID, API_KEY, SECRET_KEY)
def get_file_content(filePath):
    with open(filePath, 'rb') as fp:
        return fp.read()

def get_contend(name):
    image = get_file_content('../static/upload/'+name)
    data=client.basicAccurate(image)
    data=data.get('words_result')
    allStr=""
    for word in data:
        allStr+=word.get('words')
    return allStr


